Classification and clustering


I did a random selection of 30 songs from the playlist 4, dogsscience, to look at some clustering features.

Not surprisingly: energy and loudness are clustered together. Then valence comes together with these. Danceability and tempo are added furtheron.

The clearest outlier, by far, is the song “Violin Partida No 2. (sic, a purely harpsichord based piece of music, called”Violin…“!) On loudness and -to a lesser extend- valence and loudness. When listening to this song I can easily understand the high scores on these 3 variables.

More analysis to follow


Computational-Musicology - “It’s a dogs life”

This website describes my project for the course Computational Musicology in the third year of doing a Bachelors study Musicology at the University of Amsterdam (with a specialization in Music Cognition). The course deals with the use of computers as a tool for answering musicological questions.

My project has initially aimed to search for music playlists on Spotify with keywords ‘relax’, ‘relaxation’ or ‘calming’. Not only for humans but also -and specifically- for dogs. There is a large quantity of music (artists, albums, playlists) available on Spotify with those keywords, also for dogs (and cats, jointly our most favorite pets to live with us, human beings).

I attempted to -first broadly- search, then self-assemble and -select, qualify, compare, and (deeply) analyze music (playlists and individual songs) on Spotify, specifically searching for similarities and/or differences in ‘calming/relaxing music’ for humans and for dogs.

The interest stems from my scientific curiosity into the emotional and behavioral effects of sounds (specifically musical sounds in this project) for humans and animals (dogs here!) alike. Not least because of my love for my own pet dog, Tess, a 3-year-old Toller Retriever (see photo right here where she is alert and active -which is great- but she needs her relax moments very much too!). Her well-being means the world to me and if we can understand the potential calming effects of sounds to dogs a bit better, I hope this can assist in furthering the broad animal’s well-being policies and guidelines.

In the next tabs to the right, graphs and texts will provide some insights into the various aspects of music that I dived into for this project. I hope you’ll find it interesting to read!



Introduction to the analysis of music for this project, selected on Spotify with keywords ‘relax(ation)’/ ‘calming’; four playlists defined

For this project I have analysed playlists on Spotify with keywords ‘calming’ or ‘(relax)ing’ or ‘relaxation’. I qualified, selected & grouped them (eventually after looking at some scientific research, see below) fourfold as follows:

  1. general relaxation playlist for humans (“Humans”)
  2. general relaxation playlist for dogs (“Dogs”)
  3. specific relaxation playlist for humans, based upon (some) scientific research (“Humansscience”)
  4. specific relaxation playlist for dogs, based upon (some) scientific research (“Dogsscience”)

All 4 are own-made playlists/groups.

The overall corpus is made from songs from many playlists on Spotify that exist for those keywords. It is my working hypothesis that the first two playlists are hardly different and that a high level of anthropomorphism is applicable => we assume that what humans define and perceive as relaxing music will be true for dogs also and -hence- playlist 2 is based (assumption!) on similar criteria/elements as for playlist 1.

Multiple research from various disciplines (neurosciences, psychology, biology, animal studies, some in cooperation with musicologists) has been done into calming/relaxing effects of music, both for humans as for dogs. For the first and third group, humans, we know much more given a broader spectrum of feedback: we have language as feedback system whereas with dogs we are limited to observing their behavior and measuring bodily aspects like blood pressure, heartrate or hormone levels (like cortisol, the ‘stress hormone’).

With music for dogs, research shows that similar musical aspects towards calming apply as for humans (energy, loudness, pitch, instruments) but also differences (variety, genre, ‘nature’ sounds). On the aspect of variety I refer specifically to Bowman, 2017 wherein is stated that “..the effect of habituation may be reduced by increasing the variety of auditory enrichment provided.” (end of Abstract). In simple words: dogs get habituated (i.e. bored) when there’s little variety in music styles/genres and the calming effect of music dilutes.

Groups 3 and 4, defined on certain (bear in mind: I limited myself to just a few studies, see below) scientific research, may show (significant) differences with groups 1 and 2 on a variety of musical ‘elements’. Also between groups 3 and 4, I wanted to analyze similarities and -especially- search for differences.

All but 1 (nr. 3) playlists are large, i.e. > 200 songs each. Nr. 3 only contains 10 songs.

(’Elements” are aspects of music that Spotify allows for analysis as described on Spotify) e.g. loudness, tempo or mode (major or minor)

It might also be that ‘true’ calming music for dogs is based on musical elements that disqualify for humans as true music (i.e. pitches in sounds at frequency levels unhearable for humans but hearable for dogs. This is not in scope for this project, one reason being is that Spotify doesn’t contain (high-pitched) sounds that are non-perceivable for humans but that dogs CAN hear.

My 3d group is based upon this research into the most relaxing (i.e. anxiety reducing) songs for humans: neuroscience on anxiety reduction with official playlist. I quote from this article “…participants listened to different songs while researchers measured brain activity as well as physiological states that included heart rate, blood pressure, and rate of breathing.” The song elected as nr 1 in a top 10 of most relaxing songs is “Weightless” by Marconi Union (a song which will be deeply analysed in the next tabs). I further quote: “Equally remarkable is the fact the song was actually constructed to do so. The group that created”Weightless”, Marconi Union, did so in collaboration with sound therapists. Its carefully arranged harmonies, rhythms, and bass lines help slow a listener’s heart rate, reduce blood pressure and lower levels of the stress hormone cortisol.” The group I created for this research is an exact copy of this top 10.

I based my fourth group, called on Spotify “Through a Dogs Ear, science-based supposedly” upon the following paper and the available public playlists in Spotify labeled (published by authors of this research). See “Through a Dogs Ear”. Also have a look at a review of Leeds work The emphasis of this research is very much on a concept called psycho- and bioacoustics I quote: “Psychoacoustics is the discipline that studies the perception of sound in humans. This includes how we listen, our psychological responses, and the physiological impact of music and sound on the human nervous system. Bioacoustics is the study of sound in animals. It looks at how animals communicate, as well as the positive and negative effects of sound in their environments.” However, the claims by the authors of “Through a Dogs Ear” are refuted in a recent summary article from 2020, “Musical Dog” regarding the use of music towards dogs behaviour and well-being, stating (in Abstract): “Overall, exposure to classical music appears to have a calming influence on dogs in stressful environments, with no additional benefit observed from any music purposely designed for dogs (specifically”Through a dog’s ear”).”

(For those really interested: Animals is a well-known scientific magazine focused entirely on animals.

My expectations/assumptions about similarities and/or differences between these 4 groups in regards to the most important musical elements were roughly as follows:


The playlists used in Spotify:

Spotify playlist humans:

https://open.spotify.com/playlist/3B0FtfxNiFOo82o8lmJcIp?si=d6447cd190234b6a

Spotify playlist dogs:

https://open.spotify.com/playlist/5hQo2asoxqQrnJFeufycj1?si=565ef05c6ff24ae0

Spotify playlist humans scientific:

https://open.spotify.com/playlist/1t06IDDtn5eYo4Ow7Fwmcb?si=5d4a68e5d2334b34

Spotify playlist dogs scientific: here


A first analysis of some single musical elements across the 4 playlists


I started my analysis of the playlists with a comparison on some single elements between the 4 groups. To the left here I present 4 graphs on individual variables in the playlists and I focus on some musical elements for which I had no ‘hard’ or explicit expectations on what the outcomes would be: on acousticness, instrumentalness, valence and mode. Bear in mind that the playlist “humansscience” only contains 10 songs, hence the low bars in the histograms.

First, acousticness: a surprising difference between the 2 dogs playlists and -especially- the playlist humans.

why histogram for mode: mode is a discrete value (0 or 1 and nothing inbetween) and that’s why a histogram is the better way of displaying. The adjacent violin plot on valence has relative low values for

Tempo : the higher the happier the music (valence), the slower the music the sadder.

Really intriguing: both dogs playlists score higher on major mode than minor (regular dogs significantly) BUT….this does NOT correlate with a higher valence figures for these playlists. Whereas normally the major mode is associated with positive valence.

I believe that tempo plays the role here of ‘party pooper’ on the correlation between mode and valence.


Combined analysis of 4 key musical elements, observed over the 4 playlists


Comparing the 4 playlists on key musical elements tempo (x) , energy (y), loudness (color) and danceability (size) as can be seen in the chart left, brings up some interesting and unexpected differences. As mentioned earlier (see Tab “Introduction…”), I expected a lot of similarity across the playlists on these 4 variables (omitting speechiness here as variable). Much to my surprise, there are much bigger differences than I presumed.

Both dogs playlists score significantly lower on energy than the 2 human playlists. Bear in mind when comparing these graphs that the y axis (for energy) has a different scales for each playlist which means that the differences between humans and dogs are even more dramatic!

The same applies for loudness, where the human playlists score high (yellow) and the dogs playlists much lower (blue).

Tempo for humans centers around 120 BPM whereas for dogs it much more in the 60-80 BPM range.

On danceability also a difference can be seen (on average the dogs playlists have many more smaller cells) but not as big as with the other 3 variables.

What mostly struck me is the wide spread of the songs in playlist 3 humans science-based, across these 4 variables. As these 10 songs - supposedly- form a top 10 of most relaxing song for humans (specifically: to relief anxiety and stress e.g. pre-surgery) why do they not score similarly or at least near to the nr 1. (i.e. most relaxing) song on that list: Weightless by Marconi Union? I selected this as the ‘archetype’ song for this playlist.

With playlist nr. 4, there appears at first sight a -seemingly large- difference on energy (y-axis) level BUT the y-axis are differently scaled so on closer look they are comparable on energy level. For this playlist I chose the song Totally Beached by Joshua Leeds as ‘archetype’ song for this playlist. Partly I chose this because the song has a reggae style ‘vibe’ to it and this research has identified reggae as a preferred genre by dogs (from a relaxation perspective).


Analysis of 2 ‘archetype’ songs in terms of chroma features (providing pitch class insights) as can be seen in chromagrams


Following earlier analysis I proceeded with a few selected songs from the 2 science-based playlists to deeper analyse other aspects as provided by chromagrams

This tab explains the pitch-classes structure of the song “Weightless” from playlist 3, humans science as well from the song “Totally Beached”, an archetypical song in the playlist 4, dogs science-based.

WEIGHTLESS

I selected the song “Weightless” by Marconi Union from group 3 (humans, science-based) upon this research into relaxing capabilities of music to lower anxiety in humans (e.g. pre-surgery). This study concluded upon a top 10 list of most relaxing songs, with Weightless as nr 1.

Weightless is -intendedly- not a very energetic or (pitch/chords/beats/timbre) changing song, quite the opposite. When listening to it, I can hear the change to emphasis on D and A happening after exactly 89 seconds. Some, but very little, melodic aspects then come into play. Reason for this is, as explained by the researchers in their study, that -when trying to have humans relax to music- they want to minimize the brain activity related to predicting where the melody is developing to.

(possibly: more explanation to follow)

TOTALLY BEACHED

I selected the song “Totally beached” from the fourth group (dogs, science-based) for a further analysis because it has a strong reggae ‘vibe’ to it and certain research on the effect of music on calming dogs found that reggae music (together with soft rock and classic) is a genre preferred by dogs.

Totally Beached is a relative short song, where in the chromagram I believe to see a clear reggae-style appearance of offbeat chord elements. The song follows a classic reggae chord development between I and IV (in this case G minor and C minor). What surprises me in the chrogram is a relative small prominence of Eb, the terts in C minor. The last 10 seconds are a fading-out stall of the applied instruments, hanging on to a single C-dominated finale.


Some timbre analysis with the help of cepstrograms


On the left here are 2 cepstrograms, aimed at providing insights into the different timbre aspects of pieces of music.

The cepstrogram on ‘Weightless’, the song elected as most relaxing for humans, shows an enormous amount of c02 timbre elements, meaning a high level of brightness ‘at the expense’ of other timbre aspects. The first 16 seconds/beats of the song a spread (in green) between C2 and C03 occurs and this relates to the fade-in of the synths elements that reach peak from that moment and -thus- further concentrates in C02. 4.52 minutes into the song another high-pitched element is introduced and from that moment on some more “C02-interrupting” musical elements (mostly high-pitched sounds) are put into the mix of the audio. This can be in the occasional interruption of bright yellow in C02 after 500 seconds in conjunction with green in other timbre aspects.

For the second cepstrogram: first indications make me think that flatness is indeed high in ‘Totally Beached’. Also a relative high level of c04 which relates to the relative sharp ‘attack’ style of the strumming guitar with reggae. Between seconds 85 and 95 bass guitar and percussion are gone (less C03), then bass guitar comes back (more C02) and then percussion also comes back from second 116 and everything is back to ‘normal’. The 2 dark yellow marks for Co3 at 130 seconds and 143 seconds relate to a short cymbal sound at these moments.

Both songs, especially Weightless, score relatively low on C01 (which correlates to loudness) in these cepstrograms and this is in line with the individual loudness variable measurements by the Spotify API (-19.974 for Weightless and -18.861 for Totally Beached).


Self-Similarity Matrices


Explanation to follow; for Weightless: the song is intendedly designed to lower the BPM


Homework for week 10, keys analysis

Homework week 10 continued (part 3): chordogram on keys {data-commentary-width=“500”}

Homework week 10 continued (Chordograms) {data-commentary-width=“500”}


As most songs from all 4 playlists are -intendedly- not very ‘exciting’ in terms of a lot of musical elements (and their possible changes during a song) like tempo, energy, instrumentalness, etc. I decided to pick an outlier from playlist 3 (humansscience) which scores highest on tempo and relatively high on energy: Strawberry Swing by Coldplay, to see what happens chords-wise. A chordagram is presented here.

The song is in Ab (as tonica I) with mostly changes to IV (Db) and V (Eb). This is a rather ‘normal’ chords progression. The black spot around 95 seconds in Db appears to me the emphasis/power on Db (as ‘tension’ dominant to Ab) just before ‘releasing’ to tonica Ab (‘home’/stability). The same ‘returned home’ energy on Ab can been seen in the last 80 seconds of the song. As G# enharmonically is the same as Ab, it is no surprise that there’s relative a lot of energy in there too. There’s also a prominance to be seen in seventh chords, a usual patterns in chordagrams as explained by our lector: ‘leakage’ of energy in the 7th ‘bin’ (close to the 1st tonica) plays a role here sometimes).


Homework week 10 continued (part 3): timbre comparison between 2 playlists (humans science and dogs science) {data-commentary-width=“500”}

Homework week 10 continued (part 4): timbre comparison between 2 playlists (dogs and dogs science) {data-commentary-width=“500”}

Homework week 10 continued (part 4): loudness comparison between 2 playlists (dogs and dogs science) {data-commentary-width=“500”}


KEY ANALYSIS

A remarkable (in my opinion) similarity on keys between the groups, the mean in 3 out of 4 groups on key 5, which is F. Only “humansscience” has F# as mean. I find it very remarkable that the key of C (nr. 1), one would expect an often used key, is completely missing in these boxplots. Further to be analysed.

Analysis on chordograms to follow HERE:

As expected, an emphasis on I, IV and V prominence for a song in Ab. Interesting:a lot of dark blue in C# (enharmonically the same as Db). With knowledge of Western chords and their relationships (tonica, subdominant, dominant and others) I expected that the software would ‘know’ - in the context of this piece of music; circle of fifths!- that Db strongly ‘belongs’ to Ab and C# not really.

ON CEPSTOGRAMS:

At first sight, no c02 or c03 scores for the humans science groups, that’s…remarkable. A handicap of this comparison is that the playlist human science only contains 10 songs. But still, the absence of c02 and c03 is remarkable. In the next tab I will analyse two larger groups, dogs and dogs science.

No major differences are to be seen here between these 2 groups in terms of Timbres except perhaps that categories c06-c10 produces higher scores for Dogs Science.

LOUDNESS COMPARISON: well, at least produced a graph….now for some analysis…:)


Concluding remarks


DRAFT, bulletpoint like remarks: